#pragma once
#include <list>

namespace synteny {
struct Node {
	enum ModificationState { NotModified, ModifiedOriginalPath, ModifiedModifiedPath };
	enum Sign { PLUS, MINUS };
	bool signChanged;
	int gene;
	Sign sign;
	int chromosomeID;
	std::list<Node>::iterator nextModifiedPath
	, previousModifiedPath
	, nextOriginalPath
	, previousOriginalPath;
	std::list<std::list<Node>::iterator >::iterator hashTableIterator;
	ModificationState modificationState;
	Node(int gene, int chromosomeID);
	std::list<Node>::iterator getHeadAdjacent();
	std::list<Node>::iterator getTailAdjacent();
	void changeSign();
};

typedef Node ChromosomeNode;
typedef std::list<Node> NodesList;

struct Chromosome {
	static const int BEGIN_TERMINAL = -1, END_TERMINAL = -2;
	int chromosomeID;
	NodesList chromosome;
	Chromosome(int chromosomeID);
	NodesList::iterator tailInsertNode(int gene);
	NodesList::iterator insertNode(NodesList::iterator it, int gene);
	NodesList::iterator eraseNode(NodesList::iterator it);
private:
	Chromosome(Chromosome const & a);
	Chromosome & operator=(Chromosome const & a);
};
}
